<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:h="http://java.sun.com/jsf/html"
	  xmlns:f="http://java.sun.com/jsf/core"
	  xmlns:p="http://primefaces.org/ui"
	  xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
	<link type="text/css" rel="stylesheet" href="#{request.contextPath}/css/estilo.css" />
    <link type="text/css" rel="stylesheet" href="#{request.contextPath}/js/funcoes.js" />
	<title>Login</title>
</h:head>
<h:body>
<p:ajaxStatus onstart="PF('statusDialog').show();" onsuccess="PF('statusDialog').hide();"/>             
	<p:dialog modal="true" widgetVar="statusDialog" header="Status" draggable="false" closable="false">  
	<p:graphicImage value="/imagem/ajaxloadingbar.gif" />  
</p:dialog>
<div align="center">
<h:form id="frmLogin" prependId="false">	
	<div id="loginPainel">
		<!-- <p:messages id="messages" display="icon" /> -->
		<p:panel header="Digite seu login" id="boxDlg">
		<p:focus for="username"/>
			<p>Bem Vindo, informe seu usuário e senha para entrar no sistema.</p>
			<div>
				<h:panelGrid columns="2" cellpadding="5">
					<p:inputText id="username" value="#{beanLogin.login.login}" required="true"
								 size="30" requiredMessage="Informe seu usuário de login!" />
					<p:watermark for="username" value="Informe o usuário" />
					<p:password id="password" value="#{beanLogin.login.senha}" required="true"
								 size="30" requiredMessage="Informe a sua Senha!" />
					<p:watermark for="password" value="Informe sua senha" />
				</h:panelGrid>
				<f:facet name="footer">
				<div align="center">
					<p:commandButton action="#{beanLogin.login(actionEvent)}" value="Entrar" 
									 onclick="PrimeFaces.cleanWatermarks();" 
									 oncomplete="PrimeFaces.showWatermarks();handleLoginRequest(xhr, status, args)"
									 update="boxDlg, messages" />
					<p:commandButton type="reset" value="Limpar" />
				</div>
				</f:facet>
			</div>
		</p:panel>
		<p:messages id="messages" showDetail="true" life="3000"/>		
	</div>
</h:form>
</div>
</h:body>
</html>